﻿@model IEnumerable<mesoBoard.Data.Smiley>

@{ 
   int x = (int)ViewData["x"]; 
   int z = (int)ViewData["z"]; 
   int y = (int)Math.Ceiling(((decimal)z / x)); 
}

@{ int q = 0;  }
@{ for (int r = 0; r < y; r++)
   { 
        <tr>
        @for (int w = 0; w < x; w++)
           {
               if (q <= Model.Count() - 1)
               {  
                <td>
                    <a href="#" onclick="return false;">
                    <img src="@Url.Content("~/Images/Smilies/" + Model.ElementAt(q).ImageURL) " 
                    alt="@Model.ElementAt(q).Code " class="smileyimg" title="@Model.ElementAt(q).Code " />
                    </a>
                </td>
              q++;
               }
           }
        </tr>  
   } }


